package com.vic.controller;

import com.vic.common.response.HttpResponse;
import com.vic.entity.Article;
import com.vic.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/article")
public class ArticleController {

    @Autowired
    private ArticleService articleService;

    @PostMapping("/save")
    public HttpResponse saveArticle(@RequestBody Article article) {
        return articleService.saveArticle(article);
    }

    @PutMapping("/update")
    public HttpResponse updateArticle(@RequestBody Article article) {
        return articleService.updateArticle(article);
    }

    @DeleteMapping("/delete")
    public HttpResponse deleteArticle(@RequestBody Article article) {
        return articleService.deleteArticle(article);
    }



}
